#ifndef __H_GAME_H__
#define __H_GAME_H__

#include <deque>
#include <vector>
#include <map>
#include <set>
#include "ICC_Timer_Handler.h"
#include "RedisClient.h"
#include "GameBase.h"
#include "DbPart.h"
#include "CClient.h"
#include "def.h"
#include "LogicData.h"
#include "HostBase.h"

class CHost;

const unsigned int g_uid_mod = 100;
const unsigned int g_record_count_mod = 20;

const unsigned int g_gamerecord_delcount_onetime = 10000;
const unsigned int g_list_recent_days = 15;
const int g_westernmost_timezoneinmin = -720;

class CGameServer : public BYTimerOject
{
public:
	CGameServer();
	virtual ~CGameServer();
public:
	virtual bool InitGame();
	virtual int OnBYTimeOut(int Timerid);
	int ProcessPacket(SocketHandler * pHandler, NETInputPacket* inputPkg);
	int ProcEventPublishService(int ev_id, SpiderEvent* pEvent);
	int ProcEventGameInit(int ev_id, SpiderEvent* pEvent);
private:
	int procTimerCacheCheck(void);
	bool monthdis(const int ym1, const int ym2, int& dis);

	std::string m_procTable;
	_u64_ m_oldestRecordPoint;
	int m_oldestYm;

	unsigned int m_nodecount;
	int m_nodeindex;

	bool m_initflag;
public:
	CHost* m_pHost;
	CDbPart m_dbHandler;
	CDbPart m_dbHandlerAssistant;
	CDbPart m_dbHandlerMaintenance;
};


#endif


